$(function() {
	var payType = $("#payType").val();
	if (payType == "微信支付") {
		$("#payfs").val('2');
	} else if (payType == "支付宝(电脑版)") {
		$("#payfs").val('1');
	} else {
		$("#payfs").val('3');
	}

});


function dopay() {

	var payfs = $("#payfs").val();

	if (payfs == '2') {

		//微信支付
		var orderno = $("#orderNo").val(); //订单编号
		//	var total=1;  //金额

		var total = $("#total").val() * 100;


		//var proName=$("#proName").val();  //商品名称

		//订单信息
		var payxinxi = orderno + ":" + total;
		//微信支付
		//location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4930d0a8e3e8adce&redirect_uri=http%3A%2F%2Fwww.72gs.net%2Fwxpay%2Ftoken&response_type=code&scope=snsapi_base&state="+payxinxi+"#wechat_redirect";

		var appid = "wx08e69fae39607f0f"; 

		location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid + "&redirect_uri=http%3A%2F%2Fwww.72gs.net%2Fwxpay%2Ftoken&response_type=code&scope=snsapi_base&state=" + payxinxi + "#wechat_redirect";

		return false;
	} else if (payfs == '3') {
		//支付宝  手机版
		//if(confirm("支付宝(手机版)处于调试阶段,可能无法完成支付,是否继续?")){
		$("#payfrom").attr('action', '/alipay/wap');
		//  return true;
		//}else return false;

		//return false;
	} else {
		return true;
	}

}